<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="Scripts/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $.ajax({
            type: "get",
            url: "http://localhost:52494/api/Values/1",
            dataType: "json",
            success: function (data) {
                //success比done先执行
            }
        }).done(function (data) {
            console.log(data);
        });

        function login() {
            let name = $.trim($("#loginName").val());
            let pwd = $.trim($("#loginPwd").val());
            $.ajax({
                type: "post",
                url: "http://localhost:52494/api/User/Login",
                data: {
                    loginName: name,
                    password: pwd
                }
            }).done(function (data) {
                console.log(data);
            });
        }
    </script>
</head>
<body>
    <input type="text" id="loginName" />
    <input type="text" id="loginPwd" />
    <button onclick="login()">登录</button>
</body>
</html>